class User < ApplicationRecord
  include PgSearch

  has_many :group_users
  has_many :groups, through: :group_users
  
  pg_search_scope :search_for, against: {
    username: 'A',
    real_name: 'A',
    remarks: 'B'
  }

  def serializable_hash(options = nil)
    super.merge "type" => type
  end
end
